<template>
	<view class="warp">
		<view class="list">
			<view class="item" v-for="(item,index) in list" :key="index">
				<view class="compy">
					<view class="name">
						{{item.company}}
					</view>
					<view class="">
						{{item.workType}}
					</view>
				</view>
				<view class="bottom">
					<view class="b_top">
						<view class="name">
							{{item.name}}
						</view>
						<view class="job">
							{{item.job}}
						</view>
					</view>
					<view class="phone">
						<span>手机号：</span>
						<span style="color: #ff841f;">{{item.phone}}</span>
						<span @click="copyphonenum(item.phone)" style="margin-left: 10rpx; color: #cecece;">复制</span>
					</view>
					<view class="wxphone">
						<span>微信绑定：</span>
						<span style="color: #ff841f;">{{item.wxPhone}}</span>
						<span  @click="copyphonenum(item.wxPhone)" style="margin-left: 10rpx; color: #cecece;">复制</span>
					</view>
					<view class="address">
						<span>地址：</span>
						{{item.detailAddress}}
					</view>
				</view>
				<view class="time">
					{{item.attendTime}}
				</view>
			</view>
		</view>
	</view>
</template>

<script>
	export default {
		data() {
			return {
				list:[],
				queryform:{
					pageSize:20,
					current:1,
					attendType:'1'
					// activityState:'3'
				},
				total:0
			};
		},
		onLoad(e) {
			console.log(e);
			this.queryform.activityId=e.activityId
			this.getlist(e)
		},
		// 下拉
			onPullDownRefresh() {
				// 刷新位置
			this.getlist()
				var that=this
				setTimeout(function(){
						uni.stopPullDownRefresh()
					},1000)
			},
			onReachBottom(){
				if(this.queryform.pageSize*this.queryform.current>this.total){
					uni.showToast({
						title:"数据加载完毕",
						icon:'none'
					})
				}else{
					this.queryform.current++
					this.$request({
						url:'v3/activity/front/activity/attend/list',
						method:'GET',
						data:this.queryform
					}).then(res=>{
						this.list.push(...res.data.list)
						
					})
				}
			},
		methods:{
			// 获取报名数据
			getlist(val){
				this.$request({
					url:'v3/activity/front/activity/attend/list',
					method:'GET',
					data:this.queryform
				}).then(res=>{
					if(res.state==200){
						this.list=res.data.list
						this.total=res.data.pagination.total
					}else{
						uni.showToast({
							title:res.msg,
							icon:"none"
						})
					}
				})
			},
			copyphonenum(value){
				 uni.setClipboardData({
				        data: String(value), // 字符串
				        success: () => {
					    uni.showToast({
				                icon: 'none',
					        title: '内容已复制'
					    });
				        },
					fail(){
					    // console.log("55", value);
				        }
				    });
			},
		}
	}
</script>

<style lang="scss" scoped>
	page{
			width: 750rpx;
			margin: 0 auto;
			background: #F5F5F5;
			overflow: hidden;
		}
  .warp{
	  .list{
		  padding: 0 20rpx;
		  .item{
			  padding: 20rpx;
			  margin-top: 10rpx;
			  background-color: #fff;
			  border-radius: 10rpx;
			  .compy{
				  display: flex;
				  justify-content: space-between;
				  border-bottom: 2rpx solid #ebebeb;
				  padding-bottom: 10rpx;
				  .name{
					  font-size: 30rpx;
					  color: #ff841f;
					  font-weight: 550;
				  }
			  }
			  .bottom{
				  padding: 10rpx 0;
				  border-bottom: 2rpx solid #cecece;
				  .b_top{
					    padding: 10rpx 0;
					  display: flex;
					  justify-content: space-between;
					  .job{
						   color: #ff841f;
					  }
				  }
				  .address,.phone{
					   padding: 10rpx 0;
				  }
			  }
			  .time{
				   padding: 10rpx 0;
				   display: flex;
				   justify-content: end;
				   color: #cecece;
			  }
		  }
	  }
  }
</style>
